public class Solution389 {
    public char findTheDifference(String s, String t) {
        int[] ta=new int[26];
        int[] tb=new int[26];
        for (char c : s.toCharArray()) {
            ta[c-'a']++;
        }
        for (char c : t.toCharArray()) {
            tb[c-'a']++;
        }
        for (int i = 0; i < 26; i++) {
            if (ta[i]!=tb[i]){
                return (char)(i+'a');
            }
        }
        return ' ';
    }

    public static void main(String[] args) {
        System.out.println(new Solution389().findTheDifference("abcd","abcde"));
    }
}
